package project.dade.cn.bst.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;

import butterknife.InjectView;
import project.dade.cn.bst.R;
import project.dade.cn.bst.base.ZJPBaseBarActivity;
import project.dade.cn.bst.manager.AppApplication;

/**
 * Created by vain zhou on 2016/1/18.
 */
public class WashActivity extends ZJPBaseBarActivity implements View.OnClickListener {
    WebSettings webSettings;
    @InjectView(R.id.webView)
    WebView mWebView;
    @InjectView(R.id.wash)
    Button  wash;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_investmentweb);
        initData();
        wash.setOnClickListener(this);
    }

    private void initData() {
        webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        initSetListener();
        webSettings.setDefaultTextEncodingName("UTF-8");

    }



    private void initSetListener() {
            mWebView.loadUrl("http://q.eqxiu.com/s/a2N8w7PI");

    }
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == android.R.id.home) {
            this.finish();
            return true;
        }

        return super.onOptionsItemSelected(item);
    }



    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.wash:
                if (AppApplication.getInstance().getSpUtil().isLogin()) {
                    Intent mIntentRegInfo = new Intent(WashActivity.this, WashSubmitActivity.class);
                    startActivity(mIntentRegInfo);
                }else {
                    startActivity(new Intent(WashActivity.this, LoginActivity.class));
                }

        }

    }


}
